import { ContentModel, SelectionModel } from "../models";
export abstract class BaseOpt {
  protected _model!:ContentModel
  protected _selection:SelectionModel|undefined
  type!:string
  private _time = Date.now()
  constructor() {
  }
  attach(model: ContentModel,selection:SelectionModel){
    this._model = model
    this._selection = selection
  }
  protected isTimeout(){
    return Date.now() - this._time > 2000
  }
  abstract apply(): void;
  abstract reverse(): void;
  abstract merge(opt:BaseOpt):boolean;
}